package com.simulation.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Random;

/**
 * @Auther: xh
 * @Date: 2019/8/17 06:41
 * @Description:
 */
public class TraceLogUtils {

    public static String getTraceId(){
        String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss"));
        Random random = new Random();
        int i = 10000+random.nextInt(10000);
        String substring = String.valueOf(i).substring(1);
        return date+substring;
    }

//    public static void main(String[] args) {
//        System.out.println(getTraceId());
//    }
}
